import request from '@/utils/request'

// 创建质检项
export function createSchemeItem(data) {
  return request({
    url: '/quality/scheme-item/create',
    method: 'post',
    data: data
  })
}

// 更新质检项
export function updateSchemeItem(data) {
  return request({
    url: '/quality/scheme-item/update',
    method: 'put',
    data: data
  })
}

// 删除质检项
export function deleteSchemeItem(id) {
  return request({
    url: '/quality/scheme-item/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除质检项 */
export function deleteSchemeItemList(ids) {
  return request({
    url: `/quality/scheme-item/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得质检项
export function getSchemeItem(id) {
  return request({
    url: '/quality/scheme-item/get?id=' + id,
    method: 'get'
  })
}

// 获得质检项分页
export function getSchemeItemPage(params) {
  return request({
    url: '/quality/scheme-item/page',
    method: 'get',
    params
  })
}

// 导出质检项 Excel
export function exportSchemeItemExcel(params) {
  return request({
    url: '/quality/scheme-item/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
